---
id: linqexpression
title: 5. LinqExpression 静态类
sidebar_label: 5. LinqExpression 静态类
---

## 5.1 创建一个表达式

```cs
var expression = LinqExpression.Create<T>(u => u.Id == 1);
var expression2 = LinqExpression.Create<T>((u,i) => u.Id ==1 && i > 0);
```

## 5.2 拼接两个表达式

```cs
var expression = LinqExpression.And(expression1, expression2);
var expression2 = LinqExpression.IndexAnd(expression1, expression2);
var expression3 = LinqExpression.Or(expression2, expression3);
var expression4 = LinqExpression.IndexOr(expression2, expression3);
```